import request from '../utils/request'
import config from '../config'

//登录
export function login(form) {
    return request.post('/admin/login', form)
}

//分类列表
export function getCategoryList() {
    return request.get('/admin/category/list')
}

//分类详情
export function getCategory(params) {
    return request.get('/admin/category', { params })
}

//新增分类接口
export function addCategory(data) {
    return request.post('/admin/category/add', data)
}

//修改分类接口
export function editCategory(data) {
    return request.post('/admin/category/save', data)
}

//删除分类接口
export function delCategory(data) {
    return request.post('/admin/category/del', data)
}

// 更新图片地址
export function uploadPictureURL() {
    return config.baseURL + '/admin/upload/picture'
}